Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Collections.ObjectModel
Imports Microsoft.Xna.Framework

Public MustInherit Class StateElement
	Private _state As Enumeration.State = Enumeration.State.none
	Private _priorityState As Enumeration.PriorityState
	Private _stoppable As System.Nullable(Of Boolean)
	Private _reverse As Enumeration.SequenceReverse
	Private _offset As Vector2
	Private _ifTrue As Boolean = False
	Private _name As String = String.Empty

	Public Property Name() As String
		Get
			Return _name
		End Get
		Set
			If value Is Nothing Then
				_name = String.Empty
			Else
				_name = value
			End If
		End Set
	End Property


	Public Property IfTrue() As Boolean
		Get
			Return _ifTrue
		End Get
		Set
			_ifTrue = value
		End Set
	End Property

	Public Property OffSet() As Vector2
		Get
			Return _offset
		End Get
		Set
			_offset = value
		End Set
	End Property

	Public Property Reverse() As Enumeration.SequenceReverse
		Get
			Return _reverse
		End Get
		Set
			_reverse = value
		End Set
	End Property

	Public Property Stoppable() As System.Nullable(Of Boolean)
		Get
			Return _stoppable
		End Get
		Set
			_stoppable = value
		End Set
	End Property

	Public Property state() As Enumeration.State
		Get
			Return _state
		End Get
		Set
			_state = value
		End Set
	End Property

	Public Property Priority() As Enumeration.PriorityState
		Get
			Return _priorityState
		End Get
		Set
			_priorityState = value
		End Set
	End Property

	Public Sub New()
		_state = Enumeration.State.none
		_priorityState = Enumeration.PriorityState.Normal
		_reverse = Enumeration.SequenceReverse.Normal
		_offset = Vector2.Zero
	End Sub

	Public Sub New(state As Enumeration.State, priority As Enumeration.PriorityState)
		_state = state
		_priorityState = priority
		_reverse = Enumeration.SequenceReverse.Normal
		_offset = Vector2.Zero
	End Sub

	Public Sub New(state As Enumeration.State, priority As Enumeration.PriorityState, stoppable As System.Nullable(Of Boolean))
		_state = state
		_priorityState = priority
		_stoppable = stoppable
		_reverse = Enumeration.SequenceReverse.Normal
		_offset = Vector2.Zero
	End Sub

	Public Sub New(state As Enumeration.State, priority As Enumeration.PriorityState, reverse As Enumeration.SequenceReverse)
		_state = state
		_priorityState = priority
		_reverse = reverse
		_offset = Vector2.Zero
	End Sub


	Public Sub New(state As Enumeration.State, priority As Enumeration.PriorityState, stoppable As System.Nullable(Of Boolean), reverse As Enumeration.SequenceReverse)
		_state = state
		_priorityState = priority
		_stoppable = stoppable
		_reverse = reverse
		_offset = Vector2.Zero
	End Sub

	Public Sub New(state As Enumeration.State, priority As Enumeration.PriorityState, stoppable As System.Nullable(Of Boolean), reverse As Enumeration.SequenceReverse, offSet As Vector2)
		_state = state
		_priorityState = priority
		_stoppable = stoppable
		_reverse = reverse
		_offset = offSet
	End Sub
	Public Sub New(state As Enumeration.State)
		_state = state
		_priorityState = Enumeration.PriorityState.Normal
		_reverse = Enumeration.SequenceReverse.Normal
		_offset = Vector2.Zero
	End Sub

	Public Shared Function Parse(name As String) As Enumeration.StateTile
		Return CType([Enum].Parse(GetType(Enumeration.StateTile), name.ToLower()), Enumeration.StateTile)
	End Function



End Class

